/**
 * Program  : InitActivity.java
 * Author   : long
 * Create   : 2016年5月5日 下午6:26:27
 *
 * Copyright 2016 by Embedded Internet Solutions Inc.,
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of Embedded Internet Solutions Inc.("Confidential Information").  
 * You shall not disclose such Confidential Information and shall 
 * use it only in accordance with the terms of the license agreement 
 * you entered into with Embedded Internet Solutions Inc.
 *
 */
	
package cn.broadin.app.hotel.setup;

import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import cn.broadin.app.hotel.BaseActivity;
import cn.broadin.app.hotel.R;
import cn.broadin.app.hotel.util.XToast;
import cn.broadin.app.hotel.util.XUIHelper;
import cn.broadin.app.hotel.util.XUtils;

/**
 * 消防UI初始化设置界面
 * 
 * @author   long
 * @version  1.0.0
 * @date 2016年5月5日下午6:26:27
 */
public class InitActivity extends BaseActivity{
	
	private static final String KEY_ROOM_NUM = "S_room_num";
	private String roomNum;
	
	private EditText mEditText;
	private Button mImageView;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_init_setp_01);
		
		mEditText = (EditText) this.findViewById(R.id.input_room_num);
		mImageView = (Button) this.findViewById(R.id.auth_button);
		
		roomNum = XUtils.getSharedPreferenceConfig(this, KEY_ROOM_NUM);
		mEditText.setText(roomNum);
		
		mImageView.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				roomNum = mEditText.getText().toString();
				if(TextUtils.isEmpty(roomNum)){
					XToast.makeText(InitActivity.this, "请输入房间楼层号", 3000).show();
				} else {
					XUtils.setSharedPreferenceConfig(InitActivity.this, KEY_ROOM_NUM, roomNum);
					XUIHelper.openEvacuationMapActivity(InitActivity.this);
				}
			}
		});
	}
	
}
